from PIL import Image
import zxing  # 导入解析包

def ocr_qrcode_zxing(filename):
    # img = Image.open(filename)
    zx = zxing.BarCodeReader()  # 调用zxing二维码读取包
    # data = ''
    zxdata = zx.decode(filename)  # 图片解码
    return zxdata.parsed  # 返回记录的内容

print(ocr_qrcode_zxing("t.png"))